name: Java CI with Gradle Dev

on:
  push:
    branches:
      - dev
    paths-ignore:
      - '.github/**'
      - '.run/**'
      - '**.md'
      - '!.github/workflows/gradle.yml'
  pull_request:
    branches:
      - dev
    paths-ignore:
      - '.github/**'
      - '.run/**'
      - '**.md'
      - '!.github/workflows/gradle.yml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Set up JDK 11
        uses: actions/setup-java@v3
        with:
          java-version: 11
          java-package: jdk
          distribution: 'temurin'

      - name: Build and Package
        run: |
          ./gradlew distZip

      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: unidbg-fetch-qsign
          path: ${{ github.workspace }}/build/distributions/unidbg-fetch-qsign-*.zip
